﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace lab5
{
    public class Track
    {
        public string Title;
        public int trackLength;
        public int trackNum;
        public Track()
        {
            trackLength = 0;
            trackNum = 0;
            Title = "";
        }
    }

    public class RockMusic : Track
    {
        public string soloGuitarist;
        public string rhythmGuitarist;
        public string bassGuitarist;

        public RockMusic()
        {
            soloGuitarist = "";
            rhythmGuitarist = "";
            bassGuitarist = "";
            trackLength = 240;
            trackNum = 1;
            Title = "";
        }
    }

    public class RockMusicCover : RockMusic
    {
        public string originalArtist;

        public RockMusicCover()
        {
            soloGuitarist = "";
            rhythmGuitarist = "";
            bassGuitarist = "";
            trackLength = 320;
            trackNum = 1;
        }
    }

    public class ClassicMusic : Track
    {
        public string winds;
        public string strings;
        public string keyboards;

        public ClassicMusic()
        {
            winds = "";
            strings = "";
            keyboards = "";
            trackLength = 260;
            trackNum = 1;
        }
    }

    public class FolkMusic : Track
    {
        public string country;
        public string folkInstruments;

        public FolkMusic()
        {
            country = "";
            folkInstruments = "";
            trackLength = 200;
            trackNum = 1;
        }
    }

    public class Collection
    {
        public string collectionTitle;
        RockMusic rock = new RockMusic();
        ClassicMusic classic = new ClassicMusic();
        FolkMusic folk = new FolkMusic();
        public int colLength, numRock, numClassic, numFolk, min, sec;
        public string strRock, strClassic, strFolk, strMin, strSec;

        public void AddTrack(int p)
        {
            switch (p)
            {
                case 1:
                    colLength = colLength + rock.trackLength;
                    TimeConvert(colLength);
                    numRock = numRock + rock.trackNum;
                    strRock = Convert.ToString(numRock);
                    break;
                case 2:
                    colLength = colLength + classic.trackLength;
                    TimeConvert(colLength);
                    numClassic = numClassic + classic.trackNum;
                    strClassic = Convert.ToString(numClassic);
                    break;
                case 3:
                    colLength = colLength + folk.trackLength;
                    TimeConvert(colLength);
                    numFolk = numFolk + folk.trackNum;
                    strFolk = Convert.ToString(numFolk);
                    break;
                default: break;
            }
        }
        public void TimeConvert(int p)
        {
            min = p / 60;
            sec = p - (min * 60);
            strMin = Convert.ToString(min);
            strSec = Convert.ToString(sec);
        }
    }
}
